<!--
  Copyright 2010 Google

  Licensed under the Apache License, Version 2.0 (the "License"); you may not
  use this file except in compliance with the License. You may obtain a copy of
  the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  License for the specific language governing permissions and limitations under
  the License.

  Brian Kennish <byoogle@google.com>
-->
<title>Google Wave Notifier</title>
<style>
  body { margin: 10px; font: 84% Arial, sans-serif }

  h1 { font-size: 156% }

  h1 img { margin: 1px 5px 0 1px; vertical-align: middle }

  h2 {
    border-top: 1px solid #9cc2ef;
    background-color: #ebeff9;
    padding: 3px 5px;
    font-size: 100%
  }

  dl { padding: 0 5px }

  dt { font-weight: bold }

  dd { margin-top: 13px; margin-bottom: 13px }
</style>
<script>
  const BACKGROUND = chrome.extension.getBackgroundPage();

  onload = function() {
    const OPTION_COUNT = options.length;

    for (var i = 0; i < OPTION_COUNT; i++) {
      var option = options.elements[i];

      if (option.getAttribute('type') == 'checkbox') {
        option.onchange = function() {
          localStorage[this.name] = this.checked;
        };

        option.checked = BACKGROUND.parse(localStorage[option.name]);
      } else {
        option.onchange = function() { localStorage[this.name] = this.value; };

        option.value = localStorage[option.name];
      }
    }
  };
</script>
<h1>
  <img src="64.png" alt="Google Wave">
  Google Wave Notifier
</h1>
<h2>Options</h2>
<form id="options">
  <dl>
    <dt>Toolbar button:</dt>
    <dd>
      <input type="checkbox" name="animated" checked>
      Show animation while syncing waves
    </dd>
    <dt>Popup bubble:</dt>
    <dd>
      Show up to
      <select name="maxDigests">
        <option>5</option>
        <option>10</option>
        <option>20</option>
      </select>
      wave digests
    </dd>
    <dd>
      <input type="checkbox" name="participantAnnotated" checked>
      Show wave participants as tooltips
    </dd>
  </dl>
</form>
